HAL PWR migration: List of applicable concepts ¶
This section provides information about the HAL PWR applicable architecture concepts.
Concepts for PWR ¶
|
Concept |
Description |
|---|---|
|
HAL PWR APIs now rely on LL APIs rather than performing direct register access. |
|
|
All hardware macros have been removed from the HAL PWR driver, and equivalent services are ensured through the LL APIs. |
|
|
The HAL PWR functions were updated to return:
|
|
|
All TypeDef parts of the HAL PWR driver have been removed and replaced by
|
|
|
For the HAL PWR driver, large macros have been replaced by inline functions to maintain code consistency, improve readability, and benefit from compiler optimization. Inline functions also offer better support for debugging and strict type management, reducing the risk of errors. |
|
|
Const keywords have been added to non-modifiable pointers to ensure that either the pointer itself or the data it points to cannot be modified. This enhances code safety and readability, prevents unintended modifications, and renders code more robust and maintainable. |
|
|
There is no machine state for PWR. For the parameters, the check is performed using the
|
|
|
Merge HAL extension files with common ones and remove the EX prefix from APIs. |
Only one HAL PWR header file remains and all macros, define statements, and functions from
|
|
Remove EXTI Intrinsic Management in System HAL Drivers; Let Users Rely on EXTI HAL Driver. |
All EXTI intrinsic management in system services are removed and it will be managed through EXTI HAL driver . |
|
Split Peripheral Configuration from Start in System HAL Drivers. |
The EXTI driver configuration has been decoupled from the PWR driver. This means that the responsibility for configuring EXTI lines, which are often used as wakeup sources, is no longer handled within the PWR driver. Instead, the EXTI driver is now solely responsible for managing the configuration of external interrupts. |
|
Replace Finite Parameter Defines (Including PPP Instances) with Enum Types at HAL Levels. |
Finite parameters (including PWR instances) have been converted into enumerated types (enums) at HAL level. This improves code readability, maintainability, and type safety. |
|
Add HAL_PPP Prefix to All HAL Peripheral APIs (Defines, Macros, Types, and Functions). |
HAL PWR resources and data structure are started with
|
Other HAL PWR changes ¶
|
Concept |
Consideration |
|---|---|
|
Remove De-Initialization API |
No need to Init/DeInit APIs as the main power-related features like Voltage Scaling
Consequently, explicit initialization or de-initialization by the user is not required. |